using System;
using System.Collections.Generic;
using System.IO;
using Commons.Daos;

namespace Commons.Models.Settings
{
	[Serializable]
	public class SettingsModel : ISettingsModel
	{
		public static SettingsModel Instance { get; internal set; }

		protected IDictionary<Type, ISettings> settings;

		public SettingsModel()
		{
			this.settings = new Dictionary<Type, ISettings>();
		}

		public void AddSetting(ISettings settings)
		{
			this.settings.Add(settings.GetType(), settings);
		}

		public T GetSettings<T>() where T : ISettings
		{
			return (T) settings[typeof(T)];
		}
	}
}
